<?php
namespace Home\Controller;
use Admin\Model\PhotocateModel;
use Admin\Model\PhotoModel;
use Common\Model\CommonModel;
use Think\Controller;

class ThreeDController extends Controller{
    public function index(){

        //装修风格图
        $photocateModel=new PhotocateModel();
        $photoModel=new PhotoModel();
        $da['name']='装修风格';
        $photo_cate=$photocateModel->where($da)->find()['id'];
        if(!empty($photo_cate)){
            $arrPhoto2=$photoModel->where('photo_cate='.$photo_cate)->field('pic,name,remark')->limit(8)->select();
            $i=1;
            foreach($arrPhoto2 as $key=>$value){
                $arrPhoto2[$key]['id']=$arrPhoto2[$key]['id']+$i;
                ++$i;
            }
            $arrPhoto2=CommonModel::photo1($arrPhoto2);
            $this->assign('arrPhoto2',$arrPhoto2);
        }

        $this->display();
    }





}